package com.nbjtjc.safe.bean.runnable;

import com.nbjtjc.safe.service.emg.EmgTypeService;

import java.util.concurrent.Callable;

/**
 * @auther guqianbin
 * @date 2018/8/6 14:42
 **/
public class InitEmgRunnable implements Callable<Boolean> {
    private EmgTypeService emgTypeService;
    private int fromCompanyId=0;
    private int toCompanyId=0;

    public InitEmgRunnable() {
    }

    public InitEmgRunnable(EmgTypeService emgTypeService, int fromCompanyId, int toCompanyId) {
        this.emgTypeService = emgTypeService;
        this.fromCompanyId = fromCompanyId;
        this.toCompanyId = toCompanyId;
    }

    @Override
    public Boolean call() throws Exception {
        if(!emgTypeService.copyEmgType(fromCompanyId,toCompanyId)){
            return false;
        }
        return true;
    }
}
